<?php if(!empty($output['auction'])){?>
<?php foreach($output['auction'] as $auction){?>
<div class="saleItem">
	  <div class="avatar">
	  	<a href="index.php?act=my&op=home&uid=<?php echo $auction['user_id'];?>">
	  		<img src="<?php echo $auction['avatar'];?>" width="90%">
	  	</a>
	  	<?php if($auction['guanzhu']==1 && $_COOKIE['user_id']!=$auction['user_id']){?>
	  	<div class="focus"><a href="javascript:;" class="guanzhu" seller_id="<?php echo $auction['user_id'];?>"><img src="<?php echo TEMPLATE_SITE_URL;?>/images/follow.png"></a></div>	  	
	  	<?php }?>
	  </div>
	  <div class="saleInfo">	  			
	        <div class="nickname">	          
		        <?php if($auction['is_company']==1){?>	  	
		        	<?php if($auction['is_company_type']==1){?>
		        	<div class="business"></div>
		        	<?php }else{?>
		        	<div class="individual"></div>
		        	<?php }?>	
		        <?php }?> 	
	            <a href="index.php?act=my&op=home&uid=<?php echo $auction['user_id'];?>">
	            	<div class="sellerLevel l<?php echo strtolower($auction['level'])?>"></div>
	            	<?php echo $auction['nickname'];?>
	            </a>
	            <div class="saleAttr"></div>
	        </div>
	        <div class="desc desc<?php echo $_GET['pagenum'];?> showdesc<?php echo $auction['id'];?>" data-auction_id="<?php echo $auction['id'];?>">			<?php			$xy_des=$auction['auction_description'];			$xy_des=nl2br($xy_des);			$xy_des=str_replace("&lt;br&gt;","<br/>",$xy_des);			echo $xy_des;			?>			</div>
	        <div class="more quanwen<?php echo $auction['id'];?>">
	        	<a href="javascript:;" class="quan" data-auction_id="<?php echo $auction['id'];?>" style="color:#526ba4;font-size: 14px;line-height: 30px;">全文</a>
	        </div>
	        <div class="imgList" imgall="<?php echo $auction['id'];?>">
	        	<?php if(!empty($auction['img'])){?>
	        	<?php foreach($auction['img'] as $v){?>
	        	<div aid="<?php echo $auction['id'];?>" style="background-image: url(<?php echo bearshop_cut_image(UPLOAD_SITE_URL.'/shop/auction/'.$auction['auction_add_date'].'/'.$v['auction_img']);?>)" 
	        		url="<?php echo BASE_SITE_URL.'/index.php?act=crontab&op=shuiyin&imageurl=';?><?php echo bearshop_cut_image(UPLOAD_SITE_URL.'/shop/auction/'.$auction['auction_add_date'].'/'.$v['auction_img'],1);?>" class="showimg"></div>
	        	<?php }?>
	        	<?php }?>
	        </div>			<?php 			if($auction['auction_video']!=""){				?>				<div>				<div style="text-align:center;"><h1>视频展示</h1></div>									<video src="<?php echo $auction['auction_video'];?>" controls="" style="width:100%;border:1px solid red;">您的浏览器不支持 video 标签。</video>					        		        </div>				<?php			}			?>			
	        <div class="createTime">
	        	 <?php if($auction['freeship']==1){?>
	             <img src="<?php echo TEMPLATE_SITE_URL;?>/images/freepost.png" class="freePost"> 
	             <?php }?>
	             <?php if($auction['cashprice']>0){?>
	             <img src="<?php echo TEMPLATE_SITE_URL;?>/images/baozhengjin.png" class="hasBzj"> 
	             <?php }?>
	             <span style="color:#999"><?php echo date('m月d日',$auction['end_time']);?></span>
	             <div class="shareIt fenxiang" 
                        	auction_id="<?php echo $auction['id'];?>" 
                        	auction_description="<?php echo $auction['auction_description'];?>"
                        	nickname="<?php echo $auction['nickname'];?>"
                        	imgurl="<?php echo UPLOAD_SITE_URL.'/shop/auction/'.$auction['auction_add_date'].'/'.$auction['auction_img1'];?>"
                        	auction_link="<?php echo BASE_SITE_URL;?>/index.php?act=index&type=1&auction_id=<?php echo $auction['id'];?>&user_id=<?php echo $_COOKIE['user_id']?>">
          		 分享</div>
          		 <?php $likeclass = 'likeIt';?>
          		 <?php $likecount = count($auction['like']);?>     
          		 <?php if(!empty($auction['like'])){?>   		 
          		 <?php foreach($auction['like'] as $like){?>
          		 <?php 
          		 	if($like['user_id']==$_COOKIE['user_id']){
	          		 	$likeclass='liked';
	          		 	break;
          		 	}
          		 ?>
          		 <?php }?>
          		 <?php }?>
				 <?php 
					 if($auction['is_company']==1){
					 	if($likecount>=$output['renzheng_likenum']){
					 		$likeclass='liked';
					 	}
					 }else{
					 	if($likecount>=$output['common_likenum']){
					 		$likeclass='liked';
					 	}
					 }
				 ?>
          		 <div class="<?php if(empty($likeclass)){ echo 'likeIt';}else{ echo $likeclass;}?>" like_auction_id=<?php echo $auction['id'];?>><?php echo $auction['likenum'];?></div>
          		 <div class="popularity"><?php echo $auction['viewnum'];?></div>
          		 
          		 <?php if(($_COOKIE['user_id']==$auction['seller_id'])){?>
	          		 <?php if(($auction['auction_log_id']>0)||($auction['yikoujia_end']==1)){?>
	          		 	 <?php if(($auction['end_time']<time())||($auction['yikoujia_end']==1)){?>	 
			          		 <?php if($auction['is_show']==1){?>
			          		 <a class="saleToggle auctionshow" href="javascript:;"><span class="showauction" auction_id="<?php echo $auction['id'];?>">显示</span></a>
			          		 <?php }else{?>
			          		 <a class="saleToggle auctionhide" href="javascript:;"><span class="hideauction" auction_id="<?php echo $auction['id'];?>">隐藏</span></a>
			          		 <?php }?>
		          		 <?php }?>
	          		 <?php }else{?>
	          		 	<?php if(($auction['end_time']<time())){?>
	          		 	<?php if($auction['is_show']==1){?>
			          	<a class="saleToggle auctionshow" href="javascript:;"><span class="showauction" auction_id="<?php echo $auction['id'];?>">显示</span></a>
			            <?php }else{?>
			            <a class="saleToggle auctionhide" href="javascript:;"><span class="hideauction" auction_id="<?php echo $auction['id'];?>">隐藏</span></a>
			            <?php }?>
	          		 	<?php }else{?>
	          		 	<a class="saleToggle" href="javascript:;"><span class="xiajia" auction_id="<?php echo $auction['id'];?>">下架</span></a>  
	          		 	<?php }?>

	          		 <?php }?>         		 
          		 <?php }?>
	        </div>

	        <img like_img_auction_id="<?php echo $auction['id'];?>" src="<?php echo TEMPLATE_SITE_URL;?>/images/arrow_top.jpg" width="13" height="6" class="arrow_top" style="<?php if(empty($auction['like'])){ echo 'display:none;';}?>"> 	        
	       
	        <div class="likeBox" style="<?php if(empty($auction['like'])){ echo 'display:none;';}?>" like_div_auction_id="<?php echo $auction['id'];?>">	        	
	            <label class="likeRow" auctionavatar="<?php echo $auction['id'];?>">
	            <?php if(!empty($auction['like'])){?>	            
	            <?php foreach($auction['like'] as $like){?>
	                <a href="index.php?act=my&op=home&uid=<?php echo $like['user_id'];?>&user_id=<?php echo $_COOKIEE['user_id'];?>" class="likeAvatar" 
	                style="background-image: url(<?php echo $like['avatar'];?>)"></a>	                
	            <?php }?>	
	            <?php }?>            
	            </label>	             
	        </div>    
	        
	         	<?php if($auction['end_time']>time() && $auction['yikoujia_end']=='0'){//正在进行?>
		        <div class="stateInfo" cur="<?php echo $auction['id'];?>">
		          <div class="state">正在拍卖<i>◆</i></div>
		          <div class="endTime">距离结束：<span class="process" endtime="<?php echo $auction['end_time'];?>" aid="<?php echo $auction['id'];?>" con="<?php echo date('Y年m月d日',$auction['end_time']);?>"></span></div>
		        </div>
		        <?php if((time()>($auction['end_time']-300))&&$auction['yikoujia']=='0'){?>
		        <div class="timeline">
                	<p class="timelinedo">5分钟进入延时竞价周期</p>
                </div>	
                <?php }?>
		        <div class="bidBtns" bidaid="<?php echo $auction['id'];?>">	        
                  <div class="shareBtnLayer">
                  <?php if(intval($_COOKIE['user_id'])==$auction['seller_id']){?>
                        <div class="shareBtn fenxiang1" 
                        	auction_id="<?php echo $auction['id'];?>" 
                        	auction_description="<?php echo $auction['auction_description'];?>"
                        	nickname="<?php echo $auction['nickname'];?>"
                        	imgurl="<?php echo UPLOAD_SITE_URL.'/shop/auction/'.$auction['auction_add_date'].'/'.$auction['auction_img1'];?>"
                        	auction_link="<?php echo BASE_SITE_URL;?>/index.php?act=index&auction_id=<?php echo $auction['id'];?>&user_id=<?php echo $_COOKIE['user_id']?>">分享给朋友们</div>
                        <a href="index.php?act=index&op=qunfa"> 	
                        <div class="sendMultiMsgBtn">群发通知</div>
                        </a>
                  <?php }?>
                  </div>        
                  
                  <?php if($auction['seller_id']!=intval($_COOKIE['user_id'])){?>  
		          <div class="bidBtn bidBtngre" bidauction="<?php echo $auction['id'];?>">出价</div>
		          <?php }?>
		          <div class="updateBid">
		            <button onclick="javascript:location.href ='index.php?act=index&auction_id=<?php echo $auction['id'];?>&user_id=<?php echo $_COOKIE['user_id'];?>'">
		            	更新<i class="newbidTM"></i></button>
		          </div>
		        </div>
	         	<?php }else{?>
	         	<div class="bidBtns" bidaid="<?php echo $auction['id'];?>">             
	               <div class="saleEndBtn"><?php echo date('Y年m月d日',$auction['end_time']);?>&nbsp;拍卖结束 </div>
	            </div>
	         	<?php }?>
	        <div class="moneyInfo">
	            <div><span>￥<?php echo $auction['firstprice'];?>元</span></div>
	            <div><span>￥<?php echo $auction['addprice'];?>元</span></div>
	            <div><span>￥<?php echo $auction['cashprice'];?>元</span></div>
	        </div>	        
	        
		    <div class="moneyInfoExtend">
		    	<?php if($auction['yikoujia']>0){?>
		    	<!-- <div><span class="yan">5分钟</span></div> -->		    	
	            <div><span class="yikoujia">￥<?php echo $auction['yikoujia'];?>元</span></div>
	        	<?php }?>
	        	<?php if($auction['cankaojia']>0){?>
	        	<div><span id="cankaojia">￥<?php echo $auction['cankaojia'];?>元</span></div>
	        	<?php }?>
	        </div>
			
			
			
	        <div class="bidList" bidList="<?php echo $auction['id'];?>">
	        	<?php if(!empty($auction['log'])){?>
	        	<?php $logi = 1;?>
	        	<?php foreach($auction['log'] as $log){?>
	            <div class="ddli loglist<?php echo $auction['id'];?>" style="<?php if($logi>4){ echo 'display: none;';}?>">
	               <div class="state">
	                  <div class="bidTime"><?php echo date("Y-m-d H:i:s",$log['add_time']);?></div>
	                  <div class="bidState">
	                  	<?php if($auction['end_time']>time()){//正在进行?>
	                  	<?php if($logi == '1'){?>
	                  	<?php if($auction['yikoujia_end']==1){?>
	                  	<span class="bidDeal" state_auction_id="<?php echo $auction['id'];?>"></span><!-- 成交  -->
	                  	<?php }else{?>
	                  	<span class="bidLeader" state_auction_id="<?php echo $auction['id'];?>"></span><!-- 领先  -->
	                  	<?php }?>
	                  	<?php }else{?>
	                  	<span class="bidOut" state_auction_id="<?php echo $auction['id'];?>"></span><!-- 出局  -->
	                  	<?php }?>
	                  	<?php }else{?>
	                  	<?php if($logi == '1'){?>
	                  	<span class="bidDeal" state_auction_id="<?php echo $auction['id'];?>"></span><!-- 成交  -->
	                  	<?php }?>
	                  	<?php }?>
	                  </div>
	               </div>
	               <div class="avatar">
	               	   <a href="index.php?act=my&op=home&uid=<?php echo $log['user_id'];?>">
	                   		<img src="<?php echo $log['avatar'];?>">
	                   </a>
	                   <div class="buyerLevels l<?php echo strtolower($log['level']);?>"></div>
	               </div>
	               <div class="bidUser">
	                    <div class="name">
	                    	<a href="index.php?act=my&op=home&uid=<?php echo $log['user_id'];?>">
	                       		<?php echo $log['nickname'];?>
	                       	</a>
	                    </div>
	                    <div class="price">￥<?php echo $log['auction_price'];?>元</div>
	               </div>
	            </div>
	            <?php $logi++;?>
		        <?php }?>
		        <?php if($logi>4){?>
				<div class="ddli logmore" style="text-align:center;margin-left:auto;height:20px;" auction_id="<?php echo $auction['id'];?>">查看更多</div>
				<?php }?>
		        <?php }?>

	        </div>
	    </div>
</div>
<?php }?>
<?php }?>

<script type="text/javascript">
$(function(){
	var selector_desc = '.desc'+'<?php echo $_GET['pagenum']?>';
	$(selector_desc).each(function(){
		var h = $(this).height();
		var auction_id = $(this).data('auction_id');
		if(h>98){
			$(this).height(98);
			$(this).css("overflow","hidden");
			$(".quanwen"+auction_id).show();	
		}else{
			$(this).css("overflow","visible");	 
			$(".quanwen"+auction_id).hide();
		}
	});
});
</script>


